
//import java.math.*;
public class Cuadratica {
	
	int a;
	int b;
	int c;
	
	public Cuadratica (int a, int b, int c){
		this.a = a;
		this.b = b;
		this.c = c;
		
	}
	
	private double discriminante (){
		return Math.pow(b,2)-4*a*c;
		
	}
	
	public double[] raices (){
		double disc = discriminante();
		
		if (this.a!= 0){
			if (disc >= 0) {
				double x1=(-b+Math.sqrt(disc))/(2*a);
				double x2=(-b-Math.sqrt(disc))/(2*a);
				return new double[] {x1,x2};
			}
			else {
				return null;//si las raices no son reales devuelve null
			}
		}
		else {
			return null;//si a=0 devuelve null
		}
	}
}